package com.example.clothingmanager.dao;

import com.example.clothingmanager.bean.Clothes;
import com.example.clothingmanager.bean.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

/**
 * @author Huangyt
 * @version 1.0
 * @date 2020/5/7 16:45
 */
public interface UserDao extends JpaRepository<User, Integer> {
    public User findByAccountAndPassword(String account, String password);

    public User findByAccount(String account);

    @Query(value = "select * from user where account !=:account", nativeQuery = true, countQuery = "select count(1) from user")
    public Page<User> findAll(String account, Pageable pageable);


}
